package com.f1ussh.common.result;

import lombok.Data;

import java.util.List;

/**
 * @Author: 马腾飞
 * @CreateTime: 2025-10-01
 * @Description: 分页查询结果
 * @Version: 1.0
 */

@Data
public class PageResult<T> {
    private Long total;
    private Integer page;
    private Integer size;
    private List<T> records;

    public static <T> PageResult<T> of(Long total, Integer page, Integer size, List<T> records) {
        PageResult<T> result = new PageResult<>();
        result.setTotal(total);
        result.setPage(page);
        result.setSize(size);
        result.setRecords(records);
        return result;
    }
}
